package com.evildog.workspace.generator.runner;


import com.evildog.workspace.generator.gene.MvcGenerator;

public class MvcCodeGeneratorRunner {

    public static void main(String[] args) {
        partRun();
    }


    /**
     * 生成所有表
     * module不一样的话，建议使用 partRun
     */
    public static void run() {
        MvcGenerator mvcGenerator = new MvcGenerator();
        mvcGenerator.run(true);
    }

    private static void oneTableRun() {
        MvcGenerator mvcGenerator = new MvcGenerator();

        mvcGenerator.setServiceName("workspace-file");
        mvcGenerator.setModuleName("file");
        mvcGenerator.setHasSuper(true);
        mvcGenerator.setIncludeTables(new String[]{
                "file_object",
        });
        mvcGenerator.run(true);
    }

    /**
     * 生成指定表
     */
    public static void partRun() {
        try{
            MvcGenerator mvcGenerator = new MvcGenerator();

            mvcGenerator.setServiceName("workspace-file");
            mvcGenerator.setModuleName("file");
            mvcGenerator.setUrl("jdbc:mysql://localhost:3306/ws_file?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8");
            mvcGenerator.setHasSuper(true);

            mvcGenerator.run(true);
        }catch (Exception e){
            e.printStackTrace();
        }
    }




}
